Recently, it is deeply wished to detect a full-color logo in a document image. In case of a logo including a figure, it can not be detected using an OCR (Optical Character Recognition) technique, and therefore it is detected using a pattern matching technique. In such a pattern matching technique, matching degree between a reference image and a target image (for example, see PATENT LITERATURE #1).